package practice1B;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

/**
 * @author $Author:$
 * @version $Id: $
 */
public class Main {
	public static void main(String[] args) throws JAXBException {
		Clazz clazz = new Clazz();
		Student student1 = new Student();
		Student student2 = new Student();
		Student student3 = new Student();
		clazz.students.add(student1);
		clazz.students.add(student2);
		clazz.students.add(student3);
		student1.name = "Alberto";
		student2.name = "Patricia";
		student3.name = "Luis";
		student1.age = 21;
		student2.age = 22;
		student3.age = 21;
		student1.id = 201134441110L;
		student2.id = 201134441116L;
		student3.id = 201134441210L;
		
		JAXBContext ctx = JAXBContext.newInstance(Clazz.class);
		Marshaller msh = ctx.createMarshaller();
		msh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
		msh.marshal(clazz, System.out);
	}
}
